package ddz;

import java.util.Arrays;

public class Player {
    private String name;
    private boolean dizhu = false;//判断是不是地主
    private Pkp [] pkps = new Pkp[20];

    public  Player(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isDizhu() {
        return dizhu;
    }

    public void setDizhu(boolean dizhu) {
        this.dizhu = dizhu;
    }

    public Pkp[] getPkps() {
        return pkps;
    }

    public void setPkps(Pkp[] pkps) {
        this.pkps = pkps;
    }

    @Override
    public String toString() {

        StringBuffer sb = new StringBuffer();
        for (Pkp pkp : this.pkps){
            if (null != pkp)sb.append(pkp).append(",");
        }

        sb.deleteCharAt(sb.lastIndexOf(","));

        return name + "  " + (dizhu ? "地主\n" : "平民\n") +
                sb.toString();
    }
}
